﻿using System;
using UnityEngine;

// Token: 0x020001D5 RID: 469
public class AnimationAction : AgentAction
{
	// Token: 0x06000A12 RID: 2578 RVA: 0x00059B14 File Offset: 0x00057D14
	public AnimationAction(string animation, bool smooth = true, bool waitToComplete = false)
	{
		if (animation == string.Empty)
		{
			Debug.LogError("Animation name is empty");
		}
		this.waitToComplete = waitToComplete;
		this.animation = animation;
		this.name = "Play Animation: " + animation;
		this.smoothTransition = smooth;
	}

	// Token: 0x06000A13 RID: 2579 RVA: 0x00059B67 File Offset: 0x00057D67
	public override void StartAction()
	{
		this.agent.animationManager.PlayAnimation(this.animation, false, !this.smoothTransition);
	}

	// Token: 0x06000A14 RID: 2580 RVA: 0x00059B89 File Offset: 0x00057D89
	public override bool IsCompleted()
	{
		if (this.waitToComplete)
		{
			return this.hasStarted && this.agent.animationManager.AnimationHasFinished();
		}
		return this.hasStarted;
	}

	// Token: 0x04000F80 RID: 3968
	private string animation;

	// Token: 0x04000F81 RID: 3969
	private bool smoothTransition;

	// Token: 0x04000F82 RID: 3970
	private bool waitToComplete;
}
